import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

/**
 * Created by Administrator on 2017/5/18 0018.
 */
public class ExcelUtil {

    static String hj="dev";

    public static void main(String[] args){
        readQuesion();
    }

    public static void readQuesion(){
        Connection mysqlConn = DBHelper.getMysqlConnection(hj);
        PreparedStatement questionPstmt = null;
        ResultSet rs = null;
        try {
            String insertQuestionSql = "insert into question_buff(account_id,domain_id,domain_name,title,introduction,content) " +
                    "values(?,?,?,?,?,?);";
            questionPstmt =mysqlConn.prepareStatement(insertQuestionSql);
            for (int i = 1; i < 10000; i++) {
                questionPstmt.setInt(1, 210);
                questionPstmt.setInt(2, 11);
                questionPstmt.setString(3, "后端开发");
                questionPstmt.setString(4, "标题"+i);
                questionPstmt.setString(5, "介绍"+i);
                questionPstmt.setString(6, "内容"+i);
                questionPstmt.executeUpdate();
                System.out.println("done!!!"+i);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }finally {
            DBHelper.free(rs, questionPstmt, mysqlConn);
        }

    }
}
